<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="/common/meta.jsp"%>
<link href="<s:url value='/css/main.css'/>" rel="stylesheet"
	type="text/css" />
<link rel="stylesheet"
	href="<s:url value='/js/jquery/plugins/jquery-treeview/jquery.treeview.css'/>" type="text/css" />
<script type="text/javascript" language="JavaScript"
	src="<s:url value='/js/jquery/jquery-1.3.2.min.js'/>"></script>
<script type="text/javascript" language="JavaScript"
	src="<s:url value='/js/jquery/plugins/jquery-treeview/jquery.treeview.js'/>"></script>
<script type="text/javascript"
	src="<s:url value='/js/DatePicker/DatePicker.js'/>"></script>
<script type="text/javascript">
	function setCategory(obj, treeId){
		$("input[name='item.parentId']")[0].value = obj.getAttribute("tvalue");
		var xxs = $("#"+treeId).find("a");
		for(i=0; i<xxs.length; i++){
			xxs[i].style.backgroundColor = "";
		}
		obj.style.backgroundColor = "lightblue";
	}

	$(function(){
		$("#categoryTree").treeview({
			persist: "location",
			collapsed: false,
			unique: true
		});

		var parentId = $("input[name='item.parentId']")[0].value;
		var xxs = $("#categoryTree").find("a");
		for(i=0; i<xxs.length; i++){
			if(xxs[i].getAttribute("tvalue") == parentId) {
				xxs[i].style.backgroundColor = "lightblue";
			}
		}
	});
</script>
<title>资源分类编辑</title>
</head>
<body>
<s:if test="%{message != null}">
	<font color="red"><s:property value="message" escape="false" /></font>
</s:if>
<br />
<s:form action="CategorySave" namespace="/" method="post">
	<s:hidden name="item.id"></s:hidden>
	<table width="100%" border="0" cellpadding="3" cellspacing="1"
		bgcolor="#E2E2E2">
		<tr class="tr1">
			<td colspan="2">资源分类编辑</td>
		</tr>
		<tr class="tab">
			<td class="td1">分类名(不可包含\/:*?"<>|)：<font color="red">*</font></td>
			<td><s:textfield name="item.name" size="20"></s:textfield></td>
		</tr>
		<tr class="tab">
			<td class="td1">分类描述：</td>
			<td><s:textarea name="item.description" cols="50" rows="5"></s:textarea></td>
		</tr>
		<tr class="tab">
			<td class="td1">父分类：<font color="red">*</font></td>
			<td>
			<s:hidden name="item.parentId"></s:hidden>
			<s:property value="treeString" escape="false" />
			<s:hidden name="treeString"></s:hidden>
			</td>
		</tr>
		<tr class="tab">
			<td colspan="2"><s:submit cssClass="button" value="保存"></s:submit></td>
		</tr>
	</table>
</s:form>
<br />
</body>
</html>